import { Entity, Column } from 'typeorm';
import { PublicEntity } from './base/public.entity';

/**
 * 用户实体表
 */
@Entity({ name: 'user' })
export class UserEntity extends PublicEntity {
  @Column({ length: 36, comment: '用户id', unique: true })
  uid: string;

  @Column({ length: 32, comment: '用户名', unique: true })
  username: string;

  @Column({ length: 11, nullable: true, comment: '电话' })
  phone: string;

  @Column({ length: 32, nullable: true, comment: '邮箱' })
  email: string;

  @Column({ length: 256, comment: '密码' })
  password: string;

  @Column({ type: 'tinyint', default: 0, comment: '用户类型: 0-个人, 1-企业' })
  type: number;

  @Column({ type: 'tinyint', default: 1, comment: '用户状态: 0-禁用, 1-启用' })
  status: number;
}
